package com.tencent.qf.common.exception;

public enum ErrorCode {
    SUCCESS(200, "成功"),
    USER_NOT_EXIST(201, "用户不存在"),
    AWARD_POOL_TYPE_IS_GOLD(202, "奖池奖励为金币"),
    AWARD_POOL_ID_IS_NULL(203, "没有匹配的奖池"),
    BAD_REQUEST(400, "请求参数不正确"),
    UNAUTHORIZED(401, "账号未登录"),
    FORBIDDEN(403, "没有该操作权限"),
    NOT_FOUND(404, "请求未找到"),
    METHOD_NOT_ALLOWED(405, "请求方法不正确"),
    LOCKED(423, "请求失败，请稍后重试"), // 并发请求，不允许
    TOO_MANY_REQUESTS(429, "请求过于频繁，请稍后重试"),
    HTTP_MESSAGE_NOT_READABLE_ERROR(430, "请求参数转换异常"),

    // ========== 服务端错误段 ==========
    INTERNAL_SERVER_ERROR(500, "系统异常"),

    SEND_KAFKA_ERROR(501, "发送kafka异常"),

    // ========== 自定义错误段 ==========
    REPEATED_REQUESTS(900, "重复请求，请稍后重试"), // 重复请求
    /**
     * 签名校验失败
     */
    SIGN_FAILURE(901, "签名校验失败"),

     UNKNOWN(999, "未知错误"),
    ;


    private Integer code;
    private String msg;

    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
